import lombok.extern.slf4j.Slf4j;

import java.time.LocalDateTime;

@Slf4j
public class ThreadLocalMap01 {
    private static ThreadLocal<String> local = new ThreadLocal();
    public static void main(String[] args) {

        local.set("你好,我的第一个ThreadLocal");
        System.out.println(Thread.currentThread().getName()+"：里面的值是:"+local.get());

        new Thread(()->{
            local.set("你好我这是另外一个线程01");
            System.out.println(Thread.currentThread().getName()+"：里面的值是:"+local.get());
        },"t1").start();

        new Thread(()->{
            local.set("你好我这是另外一个线程02");
            System.out.println(Thread.currentThread().getName()+"：里面的值是:"+local.get());
        },"t2").start();

    }
}
